package com.tiancai.controller;


import com.tiancai.context.BaseContext;
import com.tiancai.pojo.po.Collect;
import com.tiancai.result.Result;
import com.tiancai.service.ICollectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tiancai
 * @since 2025-03-17
 */
@RestController
@RequestMapping("/collect")
@Tag(name = "收藏管理")
@CrossOrigin
public class CollectController {

    @Autowired
    private ICollectService collectService;
    //收藏作品
    @PostMapping("/add/{workId}")
    @Operation(summary = "收藏作品")
    public Result<Collect> add(@PathVariable Long workId){
        Collect collect = collectService.addCollect(workId);
        return Result.success(collect);
    }
}
